﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Inspire.Entities;

namespace Inspire.Classes.Common
{
    public class ContextProvider
    {
        private static object synchLock = new object();

        private static ContextProvider singletonInstance;

        private InspireEntities _context = new InspireEntities();

        public static ContextProvider GetContextProvider()
        {
            lock (synchLock)
            {
                if (ContextProvider.singletonInstance == null)
                {
                    ContextProvider.singletonInstance = new ContextProvider();
                }
            }
            return ContextProvider.singletonInstance;
        }

        public InspireEntities GetContext()
        {
            return this._context;
        }
    }
}
